package I_Chain;
import java.io.*;

public class InputChain {
    public static void main(String[] args)
    {
        String fileName = "d:\\data1.dat";
        int sum = 0;
        try
        {
            DataInputStream dataIn = new DataInputStream(
                    new BufferedInputStream(new FileInputStream(fileName)));
            sum += dataIn.readInt();
            sum += dataIn.readInt();
            sum += dataIn.readInt();
            System.out.println("The sum is "+sum);
            dataIn.close();
        }
        catch(IOException e)
        {
            System.out.println(e.getMessage());
        }
    }
}
